package cn.iocoder.yudao.module.project.dal.mysql.weightthresholdmanage;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.project.dal.dataobject.weightthresholdmanage.WeightThresholdManageDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.project.controller.admin.weightthresholdmanage.vo.*;

/**
 * 重量阈值管理 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface WeightThresholdManageMapper extends BaseMapperX<WeightThresholdManageDO> {

    default PageResult<WeightThresholdManageDO> selectPage(WeightThresholdManagePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WeightThresholdManageDO>()
                .eqIfPresent(WeightThresholdManageDO::getMaterielCode, reqVO.getMaterielCode())
                .likeIfPresent(WeightThresholdManageDO::getType, reqVO.getType())
                .eqIfPresent(WeightThresholdManageDO::getLowerWeight, reqVO.getLowerWeight())
                .eqIfPresent(WeightThresholdManageDO::getUpperWeight, reqVO.getUpperWeight())
                .eqIfPresent(WeightThresholdManageDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(WeightThresholdManageDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(WeightThresholdManageDO::getId));
    }

}